//
//  WQSearchBar.m
//  MeterCircle
//
//  Created by 魏强 on 16/6/24.
//  Copyright © 2016年 魏强. All rights reserved.
//

#import "WQSearchBar.h"

@implementation WQSearchBar

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self = [self setup];
    }
    return self;
}

/**
 *  nib的话就走这个方法
 */
- (instancetype)initWithCoder: (NSCoder *)aDecoder {
    self = [super initWithCoder: aDecoder];
    if (self) {
        self = [self setup];
    }
    return self;
}

- (instancetype)setup{
//    self.backgroundColor = TEXTFIELD_BACKGROUNDC0LOR;
    self.placeholder = @"请输入关键词搜索";
    self.keyboardType = UIKeyboardTypeDefault;
    self.showsCancelButton = NO;
    [self setBackgroundImage:[[UIImage alloc]init]];
    self.tintColor = APP_TINT_COLOR;
    [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTitle:@"取消"];
    
    return self;
}
@end
